﻿<%@ Page Title="Programmatic creation" Language="C#" MasterPageFile="~/Demo.master"
    Inherits="DemoPage" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        DNA.UI.JQuery.Draggable.ApplyTo(DraggablePanel);
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        Draggable can apply to more than one WebControls and Html Elements dynaimic on server
        side of using <b>ApplyTo</b> Method. This is a simple way to apply draggable to a control or controls.
    </div>
    <div class="dna-code">
        <demo:Code runat="server" ID="codeView" Language="c#" ShowLines="true">
            <CodeTemplate>
                Draggable draggable=Draggable.ApplyTo(DraggablePanel); 
                draggable.AutoScroll=true;
            </CodeTemplate>
        </demo:Code>
    </div>
    <asp:Panel ID="DraggablePanel" runat="server" Height="200px" Width="200px">
        <div class="ui-state-active ui-corner-top" style="padding: 5px; height: 20px;">
            Drag me around</div>
        <div style="padding: 10px; height: auto;" class="ui-widget-content ui-corner-bottom">
            I am the Panel Control enabled Draggable dynamic on server code</div>
    </asp:Panel>
    <br />
</asp:Content>
